package com.vrp3d.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vrp3d.domain.dto.news.NewsListDTO;
import com.vrp3d.domain.dto.news.NewsSearchDTO;
import com.vrp3d.domain.po.News;
import com.vrp3d.domain.po.NewsExample;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 新闻
 *
 * @author vrp3d
 */
@Repository
public interface NewsMapper {
    int countByExample(NewsExample example);

    int deleteByExample(NewsExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(News record);

    int insertSelective(News record);

    List<News> selectByExampleWithBLOBs(NewsExample example);

    List<News> selectByExample(NewsExample example);

    News selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") News record, @Param("example") NewsExample example);

    int updateByExampleWithBLOBs(@Param("record") News record, @Param("example") NewsExample example);

    int updateByExample(@Param("record") News record, @Param("example") NewsExample example);

    int updateByPrimaryKeySelective(News record);

    int updateByPrimaryKeyWithBLOBs(News record);

    int updateByPrimaryKey(News record);

    /**
     * 新闻列表
     *
     * @param page
     * @param search
     * @param status
     * @return
     */
    List<NewsListDTO> getNewsList(Page<NewsListDTO> page, @Param("search") NewsSearchDTO search, @Param("status") Integer status);
}